package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.NbCategoryMapper;
import com.ruoyi.teach.domain.NbCategory;
import com.ruoyi.teach.service.INbCategoryService;

/**
 * 课程类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class NbCategoryServiceImpl implements INbCategoryService 
{
    @Autowired
    private NbCategoryMapper nbCategoryMapper;

    /**
     * 查询课程类型
     * 
     * @param id 课程类型主键
     * @return 课程类型
     */
    @Override
    public NbCategory selectNbCategoryById(Long id)
    {
        return nbCategoryMapper.selectNbCategoryById(id);
    }

    /**
     * 查询课程类型列表
     * 
     * @param nbCategory 课程类型
     * @return 课程类型
     */
    @Override
    public List<NbCategory> selectNbCategoryList(NbCategory nbCategory)
    {
        return nbCategoryMapper.selectNbCategoryList(nbCategory);
    }

    /**
     * 新增课程类型
     * 
     * @param nbCategory 课程类型
     * @return 结果
     */
    @Override
    public int insertNbCategory(NbCategory nbCategory)
    {
        nbCategory.setCreateTime(DateUtils.getNowDate());
        return nbCategoryMapper.insertNbCategory(nbCategory);
    }

    /**
     * 修改课程类型
     * 
     * @param nbCategory 课程类型
     * @return 结果
     */
    @Override
    public int updateNbCategory(NbCategory nbCategory)
    {
        nbCategory.setUpdateTime(DateUtils.getNowDate());
        return nbCategoryMapper.updateNbCategory(nbCategory);
    }

    /**
     * 批量删除课程类型
     * 
     * @param ids 需要删除的课程类型主键
     * @return 结果
     */
    @Override
    public int deleteNbCategoryByIds(Long[] ids)
    {
        return nbCategoryMapper.deleteNbCategoryByIds(ids);
    }

    /**
     * 删除课程类型信息
     * 
     * @param id 课程类型主键
     * @return 结果
     */
    @Override
    public int deleteNbCategoryById(Long id)
    {
        return nbCategoryMapper.deleteNbCategoryById(id);
    }
}
